package com.andaily.domain.dto.account;

import com.andaily.domain.shared.paginated.DefaultPaginated;
import com.andaily.domain.shared.security.SecurityUtils;
import com.andaily.infrastructure.mybatis.data.AccountStatisticsData;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Shengzhao Li
 */
public class AccountMonthStatisticsDTO extends DefaultPaginated<AccountStatisticsData> {

    private boolean showMore;

    public AccountMonthStatisticsDTO() {
        super(12);
    }

    public boolean isShowMore() {
        return showMore;
    }

    public void setShowMore(boolean showMore) {
        this.showMore = showMore;
    }

    public void afterLoad() {
        this.showMore = isHasNext();
    }


    public Map<String, Object> queryParams() {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("userGuid", SecurityUtils.currentUserGuid());
        map.put("prePageSize", getPerPageSize());
        map.put("startIndex", getStartIndex());
        return map;
    }

}
